<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"      
	  xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      >
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Insert title here</title>
	</head>
	<body>
	<h:form>
		<h:panelGrid columns="2">
			<h:outputLabel for="login" value="Login: *"/>
			<h:inputText id="login" value="#{searchUsersBean.loginLike}"/>
			
			<h:outputLabel for="imie" value="Imię: *"/>
			<h:inputSecret id="imie" value="#{searchUsersBean.firstNameLike}"/>
			
			<h:outputLabel for="nazwisko" value="Nazwisko: *"/>
			<h:inputSecret id="nazwisko" value="#{searchUsersBean.lastNameLike}"/>
			
			<h:outputLabel for="email" value="Email: *"/>
			<h:inputSecret id="email" value="#{searchUsersBean.emailLike}"/>
			
			<h:outputLabel for="phone" value="Telefon: *"/>
			<h:inputSecret id="phone" value="#{searchUsersBean.phoneLike}"/>
			
			<h:outputLabel for="button"/>
			<h:commandButton id="button" value="OK" action="#{searchUsersBean.getUsersFromSearch()}"/>
			<br/>
			<br/>
			<h:dataTable value="#{advertisementTypeBean.getTypesList()}" var="o">

    			<h:column>
    				<!-- column header -->
    				<f:facet name="header">Id</f:facet>
    				<!-- row record -->
    				#{o.type_id}
    			</h:column>
 
    			<h:column>
    				<f:facet name="header">Name</f:facet>
    				#{o.name}
    			</h:column>

    			<h:column>
    				<f:facet name="header">Edytuj</f:facet>
    				<h:commandLink value="EDIT" action="editTypes">
    					<f:setPropertyActionListener target="#{advertisementTypeBean.selectedType}" value="#{o}" />
    				</h:commandLink>
    			</h:column>
    			
    			<h:column>
    				<f:facet name="header">Usun</f:facet>
    				<h:commandLink value="DEL" action="#{advertisementTypeBean.deleteType()}">
    					<f:setPropertyActionListener target="#{advertisementTypeBean.selectedType}" value="#{o}" />
    				</h:commandLink>
    			</h:column>
 
    		</h:dataTable>
		</h:panelGrid>
	</h:form>
	</body>
</html>